create table MenuType
(
	 [MenuTypeId] int identity(1, 1) primary key
	,[MenuTypeName] nvarchar(128)
	,[CreatedBy] int
	,[CreatedDate] datetime
	,[UpdatedBy] int
	,[UpdatedDate] datetime
	,[Status] int
)
go

CREATE PROCEDURE MenuTypeGet
	@MenuTypeId int
AS
SELECT *
FROM [MenuType]
WHERE [MenuType].[MenuTypeId] = @MenuTypeId
GO

CREATE PROCEDURE MenuTypeList
AS
SELECT *
FROM [MenuType]
ORDER BY MenuTypeId DESC
GO

CREATE PROCEDURE MenuTypeInsert
	 @MenuTypeName nvarchar(128)
	,@CreatedBy int
	,@CreatedDate datetime
	,@UpdatedBy int
	,@UpdatedDate datetime
	,@Status int
AS

INSERT INTO MenuType (
	 [MenuTypeName]
	,[CreatedBy]
	,[CreatedDate]
	,[UpdatedBy]
	,[UpdatedDate]
	,[Status]
	
) VALUES (
	 @MenuTypeName
	,@CreatedBy
	,@CreatedDate
	,@UpdatedBy
	,@UpdatedDate
	,@Status
	
)

select SCOPE_IDENTITY()
GO

CREATE PROCEDURE MenuTypeUpdate
	@MenuTypeId int, 
	@MenuTypeName nvarchar(128), 
	@CreatedBy int, 
	@CreatedDate datetime, 
	@UpdatedBy int, 
	@UpdatedDate datetime, 
	@Status int 
AS
UPDATE MenuType SET
	    [MenuTypeName] = @MenuTypeName
	   ,[CreatedBy] = @CreatedBy
	   ,[CreatedDate] = @CreatedDate
	   ,[UpdatedBy] = @UpdatedBy
	   ,[UpdatedDate] = @UpdatedDate
	   ,[Status] = @Status
WHERE [MenuType].[MenuTypeId] = @MenuTypeId
GO

CREATE PROCEDURE MenuTypeDelete
	@MenuTypeId int
AS
DELETE FROM MenuType
WHERE [MenuType].[MenuTypeId] = @MenuTypeId
GO